package com.zensun.system.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zensun.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * 部门表 sys_dept
 *
 * @author gmk
 */
@ApiModel("部门表")
@Data
@TableName("sys_dept")
public class SysDept extends BaseEntity<SysDept> {
    private static final long serialVersionUID = 1L;

    /**
     * 部门ID
     */
    @TableId
    @ApiModelProperty("部门ID")
    @Null(message = "部门ID必须为空", groups = AddGrop.class)
    @NotNull(message = "部门ID不能为空", groups = UpdateGrop.class)
    private Long deptId;

    /**
     * 父部门ID
     */
    @ApiModelProperty("父部门ID")
    @NotNull(message = "父部门ID不能为空", groups = {AddGrop.class, UpdateGrop.class})
    private Long parentId;

    /**
     * 祖级列表
     */
    @ApiModelProperty(value = "祖级列表", hidden = true)
    private String ancestors;

    /**
     * 部门名称
     */
    @NotBlank(message = "部门名称不能为空", groups = {AddGrop.class, UpdateGrop.class})
    @ApiModelProperty("部门名称")
    private String deptName;

    /**
     * 级别
     */
    @ApiModelProperty(value = "级别", hidden = true)
    private Integer level;

    /**
     * 负责人
     */
    @ApiModelProperty("负责人")
    private String leader;

    /**
     * 联系电话
     */
    @Pattern(regexp = "^1[0-9]{10}$", message = "联系电话不合法", groups = {AddGrop.class, UpdateGrop.class})
    @ApiModelProperty("联系电话")
    private String phone;

    /**
     * 邮箱
     */
    @Email(message = "邮箱格式错误", groups = {AddGrop.class, UpdateGrop.class})
    @ApiModelProperty("邮箱")
    private String email;

    /**
     * 类型（1:部门 2:项目）
     */
    @ApiModelProperty(value = "类型（1:部门 2:项目）")
    @NotBlank(message = "请选择组织机构类型", groups = {AddGrop.class})
    private String type;

    /**
     * 是否删除（0 否 1是）
     */
    @ApiModelProperty(value = "是否删除（0 否 1是）", hidden = true)
    private Integer isDelete;


}
